package com.shiguiwu.springmybatis.designpattern.strategy;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @description: 策略控制类
 * @author: stone
 * @date: Created by 2021/9/9 17:20
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.strategy
 */
@Slf4j
public class Context<T> {
    private ICouponDiscount<T> couponDiscount;

    public Context(ICouponDiscount<T> couponDiscount) {
        this.couponDiscount = couponDiscount;
    }


    public BigDecimal discountAmount(T couponInfo, BigDecimal skuPrice) {

        return this.couponDiscount.discountAmount(couponInfo, skuPrice);
    }
}
